<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/3/8
 * Time: 23:54
 */

namespace service\k3\purchase;


use service\k3\order\AbstractOrder;

class CommonPurchase extends AbstractOrder
{
    function setType()
    {
        $this->type = 'POORD';
    }

    function setTable()
    {
        $this->table = 'V_SUF_Barcode_PRT';
    }

    function setFiled()
    {
        $this->field = 'fmsourcebillno as purchase_id,fbarcode as reel_id,fnumber as sub_materiel_id,fsupplycode as supplier_id,fsupplyname as company_name,fqty as count';
    }

    function setParseSql()
    {
        $suffix = sprintf('select %s from %s ', $this->field, $this->table);
        $this->parseSql = $suffix . " where fmsourcebillno = '%s' order by fbarcode desc";
    }
}